<?php
/**
 * Created by PhpStorm.
 * User: User
 * Date: 2017/10/25
 * Time: 8:19
 */

class myException extends Exception
{
    public  function getAllInfo(){
    return "aa错误信息为:".($this->getMessage());
        }
}
class youException extends Exception
{
    public  function getAllInfo(){
        return "bb错误信息为:".($this->getMessage());
    }
}
try{

        $x=new myException("发生错误了");

        throw $x;

}catch (myException $e){
    echo  $e->getAllInfo();

}catch (Exception $e){
    echo  $e->getAllInfo();

}